# backend/config.py
import os
from dotenv import load_dotenv
from datetime import timedelta

load_dotenv()


class Settings:
    SECRET_KEY: str = os.getenv("SECRET_KEY", "your-strong-secret-key-32-characters")
    ALGORITHM: str = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 7  # 7天
    DOUBAN_API_KEY: str = os.getenv("DOUBAN_API_KEY", "")
    NLC_API_KEY: str = os.getenv("NLC_API_KEY", "")

    # 安全配置
    PBKDF2_ITERATIONS: int = 1000  # 密码哈希迭代次数


settings = Settings()
SECRET_KEY = settings.SECRET_KEY
ALGORITHM = settings.ALGORITHM
ACCESS_TOKEN_EXPIRE_MINUTES = settings.ACCESS_TOKEN_EXPIRE_MINUTES
PBKDF2_ITERATIONS = settings.PBKDF2_ITERATIONS
